package com.gen.utils.ngen;

import com.gen.utils.Pinyin4jHelper;
import com.gen.utils.RandomUtils;
import com.spreada.utils.chinese.ZHConverter;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Administrator on 2016/9/27.
 */
public class NameGenUtils {
    public static String[] firstNames = {
            "李","王","张","刘","陈","杨","赵","黄","周","吴","徐","孙","胡","朱","高","林","何","郭","马","罗",
            "梁","宋","郑","谢","韩","唐","冯","于","董","萧","程","曹","袁","邓","许","傅","沈","曾","彭","吕",
            "苏","卢","蒋","蔡","贾","丁","魏","薛","叶","阎","余","潘","杜","戴","夏","钟","汪","田","任","姜",
            "范","方","石","姚","谭","廖","邹","熊","金","陆","郝","孔","白","崔","康","毛","邱","秦","江","史",
            "顾","侯","邵","孟","龙","万","段","漕","钱","汤","尹","黎","易","常","武","乔","贺","赖","龚","文",
            "庞","樊","兰","殷","施","陶","洪","翟","安","颜","倪","严","牛","温","芦","季","俞","章","鲁","葛",
            "伍","韦","申","尤","毕","聂","丛","焦","向","柳","邢","路","岳","齐","沿","梅","莫","庄","辛","管",
            "祝","左","涂","谷","祁","时","舒","耿","牟","卜","路","詹","关","苗","凌","费","纪","靳","盛","童",
            "欧","甄","项","曲","成","游","阳","裴","席","卫","查","屈","鲍","位","覃","霍","翁","隋","植","甘",
            "景","薄","单","包","司","柏","宁","柯","阮","桂","闵","欧阳","解","强","柴","华","车","冉","房","边"};
    public static String[] maleSecondNames = {
            "晨","轩","清","睿","宝","涛","华","国","亮","新","凯","志","明","伟","嘉","东","洪","建","文","子",
            "云","杰","兴","友","才","振","辰","航","达","鹏","宇","衡","佳","强","宁","丰","波","森","学","民",
            "永","翔","鸿","海","飞","义","生","凡","连","良","乐","勇","辉","龙","川","宏","谦","锋","双","霆",
            "玉","智","增","名","进","德","聚","军","兵","忠","廷","先","江","昌","政","君","泽","超","信","腾",
            "恒","礼","元","磊","阳","月","士","洋","欣","升","恩","迅","科","富","函","业","胜","震","福","瀚",
            "瑞","朔","津","韵","荣","为","诚","斌","广","庆","成","峰","可","健","英","功","冬","锦","立","正",
            "禾","平","旭","同","全","豪","源","安","顺","帆","向","雄","材","利","希","风","林","奇","易","来",
            "咏","岩","启","坤","昊","朋","和","纪","艺","昭","映","威","奎","帅","星","春","营","章","高","伦",
            "庭","蔚","益","城","牧","钊","刚","洲","家","晗","迎","罡","浩","景","珂","策","皓","栋","起","棠",
            "登","越","盛","语","钧","亿","基","理","采","备","纶","献","维","瑜","齐","凤","毅","谊","贤","逸",
            "卫","万","臻","儒","钢","洁","霖","隆","远","聪","耀","誉","继","珑","哲","岚","舜","钦","琛","金",
            "彰","亭","泓","蒙","祥","意","鑫","朗","晟","晓","晔","融","谋","宪","励","璟","骏","颜","焘","垒",
            "尚","镇","济","雨","蕾","韬","选","议","曦","奕","彦","虹","宣","蓝","冠","谱","泰","泊","跃","韦",
            "怡","骁","俊","沣","骅","歌","畅","与","圣","铭","溓","滔","溪","巩","影","锐","展","笑","祖","时",
            "略","敖","堂","崊","绍","崇","悦","邦","望","尧","珺","然","涵","博","淼","琪","群","驰","照","传",
            "诗","靖","会","力","大","山","之","中","方","仁","世","梓","竹","至","充","亦","丞","州","言","佚",
            "序","宜","工"};

    public static String[] femaleSecondNames = {
            "筠","柔","竹","霭","凝","晓","欢","霄","枫","芸","菲","寒","伊","亚","宜","可","姬","舒","影","荔",
            "枝","思","丽","秀","娟","英","华","慧","巧","美","娜","静","淑","惠","珠","翠","雅","芝","玉","萍",
            "红","娥","玲","芬","芳","燕","彩","春","菊","勤","珍","贞","莉","兰","凤","洁","梅","琳","素","云",
            "莲","真","环","雪","荣","爱","妹","霞","香","月","莺","媛","艳","瑞","凡","佳","嘉","琼","桂","娣",
            "叶","璧","璐","娅","琦","晶","妍","茜","秋","珊","莎","锦","黛","青","倩","婷","姣","婉","娴","瑾",
            "颖","露","瑶","怡","婵","雁","蓓","纨","仪","荷","丹","蓉","眉","君","琴","蕊","薇","菁","梦","岚",
            "苑","婕","馨","瑗","琰","韵","融","园","艺","咏","卿","聪","澜","纯","毓","悦","昭","冰","爽","琬",
            "茗","羽","希","宁","欣","飘","育","滢","馥","诗","琪"};

    public static String[] koreaMainName = {
            "김","이","박","최","정","강","조","윤","장","명","임"
    };

    public static String[] koreaName = {
            "간","감","견","고","공","권","남","문","민","배","백","범","서","섭","성","소","손","송","신","심","안","양","엄",
            "염","오","옥","우","운","유","전","지","차","채","추","하","한","홍","화","황"
    };

    public static String[] koreaManLastName = {
            "빈","혁","가수","건우","건형","경민","경섭","경호","광현","구철","국진","규태","규한","규현","기범","기선",
            "기숙","기영","기우","기임","남진","다현","대관","대중","대학","동건","동규","동근","동완","동욱","동원","동일",
            "동해","동현","동희","래원","래환","려욱","만석","명민","문우","문중","문지","민규","민기","민석","민선","민수",
            "민우","민준","민혁","민호","범수","병국","병기","병서","병욱","병전","보석","빈","상경","상민","상우","상원",
            "상중","상혁","상훈","서진","석규","석훈","선군","선우","선호","성모","성민","성수","성우","성원","성재","성진",
            "성택","성호","성훈","세빈","세윤","세창","수노","수만","수우","순원","순재","승기","승범","승선","승수","승우",
            "승철","승헌","승현","승호","승환","승훈","시경","시완","시원","시후","신양","양우","언","연석","영광","영규",
            "영운","영호","예준","오중","완규","용건","용수","용우","용준","용하","용화","우","우빈","우성","우진","우철",
            "우혁","원종","유석","유천","윤호","은혁","인성","인준","인표","인혁","일국","재룡","재모","재범","재상","재석",
            "재용","재우","재욱","재원","재중","재진","재현","재황","재효","저희","정","정민","정신","정아","정은","정재",
            "정진","정철","정태","정혁","정현","정환","정훈","종운","종원","종현","주혁","주현","준규","준기","준래","준수",
            "준숙","준영","준우","준호","중국","중문","중석","중혁","중훈","지빈","지석","지섭","지용","지창","지태","지훈",
            "진성","진영","진우","진욱","진표","진호","창민","창선","창수","창정","창준","창훈","철민","철수","철영","태성",
            "태우","태임","태현","태형","하늘","하준","학우","학준","해일","혁","혁재","현균","현우","현욱","현재","현정",
            "현준","형재","형중","혜경","혜성","혜원","호경","호영","호진","효린","효신","효정","효진","훈우","흥수","희도",
            "희석","희준","희철","희현"
    };

    public static String[] koreaWomanLastName = {
            "수","지","진","가인","가희","고은","규리","근영","나라","나영","남주","남지","다해","도연","두나","두심","려원",
            "려현","리나","리수","리흔","명길","미경","미니","미리","미선","미숙","미연","민선","민숙","민아","민영","민원","민정",
            "민지","민희","보경","보라","보미","보영","빈임","사랑","상미","상채","서연","서진","서희","선미","선아","선영","선자",
            "설빈","설원","성연","성옥","세빈","소리","소미","소연","소영","수","수경","수라","수란","수미","수민","수빈","수아",
            "수연","수영","수원","수정","수진","수현","수혜","숙용","슬기","승미","시은","신애","신주","신혜","아라","아서","아중",
            "애","애라","애정","여진","연수","연원","연희","영아","영애","예선","예슬","예원","예인","예진","옥리","옥진","옥희",
            "요원","우임","우정","유리","유미","유진","윤아","윤진","윤혜","윤희","은경","은미","은비","은성","은아","은옥","은정",
            "은주","은진","은하","은혜","은희","인영","인화","임현","자현","자흔","재영","정늘","정아","정연","정원","정윤","정은",
            "정음","정임","정현","정화","주현","지","지민","지수","지아","지연","지영","지우","지운","지원","지윤","지하","지현",
            "지혜","지효","지희","진","진실","진아","진영","진은","진희","채림","채빈","채영","채은","천설","청아","태란","태연",
            "태영","태희","하늘","하라","하원","해영","향기","현","현늘","현아","현영","현예","현정","현주","현지","현진","혜교",
            "혜늘","혜련","혜리","혜빈","혜선","혜성","혜수","혜숙","혜영","혜원","혜정","혜진","혜현","효리","효림","효민","효연",
            "효주","효진","희본","희선","희애","희영","희진"
    };

    /**
     * 性随机取：越靠前，随机的几率越高
     * @return
     */
    public static String getFirstName(){
        //递减基数;

        int len = firstNames.length;
        Random random = new Random();
        int ind = random.nextInt(8*len);
        for (int i = 0;i<2;i++){
            if(ind == 0)break;
            ind = random.nextInt(ind);
        }
        if(ind>len){
            ind = len;
        }
        if(ind != 0){
            ind = random.nextInt(ind);
        }
        return firstNames[ind];
    }

    /**
     * 名字生成
     * @param sex 性别
     * @param nameLen 名的长度
     * @param firstname 性
     * @return
     */
    public static String genName(int sex,int nameLen,String firstname){
        Random random = new Random();
        String name = firstname;
        if(sex == 0){
            int nlen = femaleSecondNames.length;
            for(int i= 1;i<=nameLen ;i++){
                name += femaleSecondNames[random.nextInt(nlen)];
            }
        }else{
            int nlen = maleSecondNames.length;
            for(int i= 1;i<=nameLen ;i++){
                name += maleSecondNames[random.nextInt(nlen)];
            }
        }
        return name;
    }

    /**
     * 名字生成
     * @param sex 性别
     * @param nameLen 名的长度
     * @param firstname 性
     * @return
     */
    public static String genNameK(int sex,int nameLen,String firstname){
        Random random = new Random();
        String name = firstname + " ";
        if(sex == 0){
            int nlen = femaleSecondNames.length;
            for(int i= 1;i<=nameLen ;i++){
                name += femaleSecondNames[random.nextInt(nlen)];
            }
        }else{
            int nlen = maleSecondNames.length;
            for(int i= 1;i<=nameLen ;i++){
                name += maleSecondNames[random.nextInt(nlen)];
            }
        }
        return name;
    }

    /**
     * 随机名字生成
     * @return
     */
    public static String genName(){
        Random random = new Random();
        int sex = random.nextInt(2);
        int nameLen = random.nextInt(2)+1;
        String firstName = getFirstName();
        return genName(sex,nameLen,firstName);
    }

    /**
     * 随机名字生成
     * @return
     */
    public static String genName(int sex){
        Random random = new Random();
        int nameLen = random.nextInt(2)+1;
        String firstName = getFirstName();
        return genName(sex,nameLen,firstName);
    }

    public static String genNameSpace(int sex){
        Random random = new Random();
        int nameLen = random.nextInt(2)+1;
        String firstName = getFirstName();
        return genNameK(sex,nameLen,firstName);
    }

    public static String genNamePinYin(int sex) {
        String [] result = {"", ""};
        Random random = new Random();
        int nameLen = random.nextInt(2)+1;
        String firstName = getFirstName();
        String firstNamePinyin = genNamePinYin(firstName);
        String endName = "";
        if(sex == 0){
            int nlen = femaleSecondNames.length;
            for(int i= 1;i<=nameLen ;i++){
                endName += femaleSecondNames[random.nextInt(nlen)];
            }
        }else{
            int nlen = maleSecondNames.length;
            for(int i= 1;i<=nameLen ;i++){
                endName += maleSecondNames[random.nextInt(nlen)];
            }
        }
        String endNamePinyin = genNamePinYin(endName);

        firstNamePinyin = firstNamePinyin + " " + endNamePinyin;
        return firstNamePinyin;
    }

    public static String genNamePinYin(String str) {
        String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？]";
        str = Pinyin4jHelper.converterToSpell(str);
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(str);
        return m.replaceAll("").trim();
    }

    public static String genNamesplit(int sex){
        Random random = new Random();
        int nameLen = random.nextInt(2)+1;
        String firstName = getFirstName()+"|";
        return genName(sex,nameLen,firstName);
    }

    public static String getTwInsNickname(int sex){
        String nicename = "";
        int r = new Random().nextInt(100);
        boolean needAge = false;
        if(r<15){
            nicename = NameGenUtils.genName(sex,new Random().nextInt(2)+1,"");
        }else if(r<30){// 李三 jack
            nicename = NameGenUtils.genName(sex)+" "+EngNameGenUtils.genFirstName(sex);
        }else if(r<45){// Jack 李三
            nicename = EngNameGenUtils.genFirstName(sex) +" "+ NameGenUtils.genName(sex);
        }else if(r<55){// Jack cheng
            nicename = EngNameGenUtils.genFirstName(sex) +" "+ NameGenUtils.genNamePinYin(NameGenUtils.getFirstName() );
            needAge = true;
        }else if(r<70){// 李 lily
            nicename = NameGenUtils.getFirstName()+" "+ EngNameGenUtils.genFirstName(sex);
            needAge = true;
        }else if(r<85){// Lily 李
            nicename = EngNameGenUtils.genFirstName(sex) + " " +NameGenUtils.getFirstName();
            needAge = true;
        }else {
            nicename = NameGenUtils.genName(sex);
            //nicename = NameGenUtils.genNameSpace(sex);
        }
        if(needAge){
            String num = "";

            if(new Random().nextInt(100)<15){
                int ageRand = new Random().nextInt(100);
                if(ageRand<100){
                    num = (1985+new Random().nextInt(15))+"";
                }
//                else if(ageRand<70){
//                    String month = (1+new Random().nextInt(12))+"";
//                    month = month.length()==1?"0"+month:month;
//                    num = (1985+new Random().nextInt(15))+"."+month;
//                }else {
//                    String month = (1+new Random().nextInt(12))+"";
//                    month = month.length()==1?"0"+month:month;
//                    String day = (1+new Random().nextInt(28))+"";
//                    day = day.length()==1?"0"+day:day;
//                    num = month+"."+day;
//                }
            }
            nicename = nicename +" "+ num;
        }


        nicename = ZHConverter.convert(nicename,ZHConverter.TRADITIONAL);
        if(new Random().nextInt(100)<30){
            nicename = nicename + DynamicText.getRandEmoji();
        }
        if(new Random().nextInt(100)<10){
            nicename = toRandomFont(nicename);
        }
        return  nicename;
    }

    public static String getTwFbNickname(int sex){
        int i = RandomUtils.fantiRandom();
        if(i == 1){
            // 生成昵称
            String nickname = NameGenUtils.genNameK(sex, 2, NameGenUtils.getFirstName());
            String nick = ZHConverter.convert(nickname, ZHConverter.TRADITIONAL);
            return nick;
        }else if(i == 2){
            // 中文拼音姓
            String firstname =  NameGenUtils.genNamePinYin(NameGenUtils.getFirstName());
            // 英文名
            String lastname = EngNameGenUtils.genName(sex,"");
            return firstname+" "+lastname;
        }else {
            return NameGenUtils.genNamePinYin(NameGenUtils.genName());
        }
    }

    public static String unicodeToString(String unicode) {
        StringBuffer string = new StringBuffer();
        String[] hex = unicode.split("\\\\u");
        for (int i = 1; i < hex.length; i++) {
            int data = Integer.parseInt(hex[i], 16);// 转换出每一个代码点
            string.append((char) data);// 追加成string
        }
        return string.toString();
    }
    static  String[] font_script =  {"𝒶","𝒷","𝒸","𝒹","ℯ","𝒻","ℊ","𝒽","𝒾","𝒿","𝓀","𝓁","𝓂","𝓃","ℴ","𝓅","𝓆","𝓇","𝓈","𝓉","𝓊","𝓋","𝓌","𝓍","𝓎","𝓏","𝒜","ℬ","𝒞","𝒟","ℰ","ℱ","𝒢","ℋ","ℐ","𝒥","𝒦","ℒ","ℳ","𝒩","𝒪","𝒫","𝒬","ℛ","𝒮","𝒯","𝒰","𝒱","𝒲","𝒳","𝒴","𝒵"};
    static  String[] font_script_bold =   {"𝓪","𝓫","𝓬","𝓭","𝓮","𝓯","𝓰","𝓱","𝓲","𝓳","𝓴","𝓵","𝓶","𝓷","𝓸","𝓹","𝓺","𝓻","𝓼","𝓽","𝓾","𝓿","𝔀","𝔁","𝔂","𝔃","𝓐","𝓑","𝓒","𝓓","𝓔","𝓕","𝓖","𝓗","𝓘","𝓙","𝓚","𝓛","𝓜","𝓝","𝓞","𝓟","𝓠","𝓡","𝓢","𝓣","𝓤","𝓥","𝓦","𝓧","𝓨","𝓩"};

    static  String[] font_gothic = {"𝔞","𝔟","𝔠","𝔡","𝔢","𝔣","𝔤","𝔥","𝔦","𝔧","𝔨","𝔩","𝔪","𝔫","𝔬","𝔭","𝔮","𝔯","𝔰","𝔱","𝔲","𝔳","𝔴","𝔵","𝔶","𝔷","𝔄","𝔅","ℭ","𝔇","𝔈","𝔉","𝔊","ℌ","ℑ","𝔍","𝔎","𝔏","𝔐","𝔑","𝔒","𝔓","𝔔","ℜ","𝔖","𝔗","𝔘","𝔙","𝔚","𝔛","𝔜","ℨ"};
    static  String[] font_gothic_bold =  {"𝖆","𝖇","𝖈","𝖉","𝖊","𝖋","𝖌","𝖍","𝖎","𝖏","𝖐","𝖑","𝖒","𝖓","𝖔","𝖕","𝖖","𝖗","𝖘","𝖙","𝖚","𝖛","𝖜","𝖝","𝖞","𝖟","𝕬","𝕭","𝕮","𝕯","𝕰","𝕱","𝕲","𝕳","𝕴","𝕵","𝕶","𝕷","𝕸","𝕹","𝕺","𝕻","𝕼","𝕽","𝕾","𝕿","𝖀","𝖁","𝖂","𝖃","𝖄","𝖅"};
;
    static  String[] font_doublestruck =  {"𝕒","𝕓","𝕔","𝕕","𝕖","𝕗","𝕘","𝕙","𝕚","𝕛","𝕜","𝕝","𝕞","𝕟","𝕠","𝕡","𝕢","𝕣","𝕤","𝕥","𝕦","𝕧","𝕨","𝕩","𝕪","𝕫","𝔸","𝔹","ℂ","𝔻","𝔼","𝔽","𝔾","ℍ","𝕀","𝕁","𝕂","𝕃","𝕄","ℕ","𝕆","ℙ","ℚ","ℝ","𝕊","𝕋","𝕌","𝕍","𝕎","𝕏","𝕐","ℤ"};

    static  String[] font_serif_italic = {"𝒂","𝒃","𝒄","𝒅","𝒆","𝒇","𝒈","𝒉","𝒊","𝒋","𝒌","𝒍","𝒎","𝒏","𝒐","𝒑","𝒒","𝒓","𝒔","𝒕","𝒖","𝒗","𝒘","𝒙","𝒚","𝒛","𝑨","𝑩","𝑪","𝑫","𝑬","𝑭","𝑮","𝑯","𝑰","𝑱","𝑲","𝑳","𝑴","𝑵","𝑶","𝑷","𝑸","𝑹","𝑺","𝑻","𝑼","𝑽","𝑾","𝑿","𝒀","𝒁"};
    static  String[] font_serif = {"𝐚","𝐛","𝐜","𝐝","𝐞","𝐟","𝐠","𝐡","𝐢","𝐣","𝐤","𝐥","𝐦","𝐧","𝐨","𝐩","𝐪","𝐫","𝐬","𝐭","𝐮","𝐯","𝐰","𝐱","𝐲","𝐳","𝐀","𝐁","𝐂","𝐃","𝐄","𝐅","𝐆","𝐇","𝐈","𝐉","𝐊","𝐋","𝐌","𝐍","𝐎","𝐏","𝐐","𝐑","𝐒","𝐓","𝐔","𝐕","𝐖","𝐗","𝐘","𝐙"};

    public static String toRandomFont(String id){
        int randfont = new Random().nextInt(7);
        String[] font = null;
        if(randfont == 0){
            font = font_script;
        }
        if(randfont == 1){
            font = font_script_bold;
        }
        if(randfont == 2){
            font = font_gothic;
        }
        if(randfont == 3){
            font = font_gothic_bold;
        }
        if(randfont == 4){
            font = font_doublestruck;
        }
        if(randfont == 5){
            font = font_serif_italic;
        }
        if(randfont == 6){
            font = font_serif;
        }
        String d = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        StringBuffer name = new StringBuffer();
        for (char c: id.toCharArray() ) {
            if(c >='a' && c <= 'z'){
                name.append(font[d.indexOf(c)]);
            }else if(c >='A' && c <= 'Z'){
                name.append(font[d.indexOf(c)]);
            }else {
                name.append(c);
            }
        }
        return name.toString();

    }

    // 韩主姓
    public static String getkoreaFirstName(){
        List<String> list = new ArrayList<>();
        for(int i=0;i<22;i++){
            list.add("김");
        }
        for(int i=0;i<15;i++){
            list.add("이");
        }
        for(int i=0;i<9;i++){
            list.add("박");
        }
        for(int i=0;i<5;i++){
            list.add("최");
        }
        for(int i=0;i<5;i++){
            list.add("정");
        }
        for(int i=0;i<3;i++){
            list.add("강");
        }
        for(int i=0;i<2;i++){
            list.add("조");
            list.add("윤");
            list.add("장");
            list.add("임");
        }
        for(String str:koreaName){
            list.add(str);
        }
        Collections.shuffle(list);
        return list.get(0);
    }

    // 随机韩国名称
    public static String getKoreaLastName(int sex){
        List<String> list = sex == 0 ? Arrays.asList(koreaWomanLastName) : Arrays.asList(koreaManLastName);
        Collections.shuffle(list);
        return list.get(0);
    }

    // 生成韩文名称
    public static String getKoreaName(int sex){
        String firstName = KRNameGenUtils.genFamilyName();
        String lastname = KRNameGenUtils.genName(sex);
        int i = RandomUtils.getRandomInt(1,5);
        if(i == 1){
            return firstName+lastname;
        }else if(i == 2){
            return lastname;
        }else if(i == 3){
            return firstName+lastname+DynamicText.getRandEmoji();
        }else if(i == 4){
            int x = RandomUtils.getRandomInt(1,5);
            if(x == 1){
                return lastname+DynamicText.getRandEmoji();
            }else {
                return firstName+lastname;
            }
        }else {
            return DynamicText.getRandEmoji();
        }
    }

    // 自定义韩文名
    public static String getKoreaNameCustom(int sex){
        String firstName = KRNameGenUtils.genFamilyName();
        String lastname = KRNameGenUtils.genName(sex);
        // 权重
        String res = RandomUtils.getRandomWeight(20,80);
        // 根据类型生成
        String type = RandomUtils.getKoreType();
        String name = "";
        switch (type) {
            case "1":
                // 韩国姓+英文名
                name = firstName+EngNameGenUtils.genFirstName(sex);
                name = res.equals("1") ?  NameGenUtils.toRandomFont(name):name;
                break;
            case "2":
                //  韩国姓.韩国名
                name = firstName+"."+lastname;
                break;
            case "3":
                // 英文名
                name = EngNameGenUtils.genFirstName(sex);
                name = res.equals("1") ?  NameGenUtils.toRandomFont(name):name;
                break;
            case "4":
                // 韩国名+表情
                name = lastname+DynamicText.getRandEmoji();
                break;
            case "5":
                // 韩国姓名
                name = firstName+lastname;
                break;
            case "6":
                // 英文名+数字
                name = EngNameGenUtils.genFirstName(sex)+RandomUtils.getKoreNumber();
                name = res.equals("1") ?  NameGenUtils.toRandomFont(name):name;
                break;
            case "7":
                // 韩国姓_韩国名
                name = firstName+"_"+lastname;
                break;
            case "8":
                // 韩国名字+年、生日随机
                name = lastname+RandomUtils.getKoreNumber();
                name = res.equals("1") ?  NameGenUtils.toRandomFont(name):name;
                break;
            case "9":
                // 英文名+（空格）韩国姓
                name = EngNameGenUtils.genFirstName(sex)+" "+firstName;
                name = res.equals("1") ?  NameGenUtils.toRandomFont(name):name;
                break;
            case "10":
                // 韩国姓+空格+英文名
                name = firstName+" "+EngNameGenUtils.genFirstName(sex);
                name = res.equals("1") ?  NameGenUtils.toRandomFont(name):name;
                break;
            case "11":
                // 韩国姓（空格）韩国名
                name = firstName+" "+lastname;
                break;
            case "12":
                // 韩国姓.韩国名+表情
                name = firstName+"."+lastname+DynamicText.getRandEmoji();
                break;
            case "13":
                // 韩国姓名+特殊符号
                int i = com.xuan.xutils.utils.RandomUtils.getRandomInt(1,3);
                if(i == 1){
                    name = DynamicText.getRandomBq(1)+firstName+lastname;
                }else if(i == 2){
                    name = firstName+DynamicText.getRandomBq(1)+lastname;
                }else {
                    name = firstName+lastname+DynamicText.getRandomBq(1);
                }
                break;
            default:
                // 默认
                name = getKoreaName(sex);
                break;
        }
        return name;
    }

    public static String getItaNameCustom(int sex){
        String firstName = ITANameGenUtils.genFirstName();
        String lastname = ITANameGenUtils.genName(sex);
        // 根据类型生成
        String type = RandomUtils.getItaType();
        String name = "";
        switch (type) {
            case "1":
                // 名+姓
                name = lastname+firstName;
                break;
            case "2":
                //  名
                name = lastname;
                break;
            case "3":
                // 名_姓
                name = lastname+"_"+firstName;
                break;
            case "4":
                // 名.姓
                name = lastname+"."+firstName;
                break;
            default:
                // 名 姓
                name = lastname + " " + firstName;
                break;
        }
        int i = RandomUtils.itaRandomWeight();
        if(i == 1){
            return NameGenUtils.toRandomFont(name);
        }else if(i == 2){
            return name+DynamicText.getRandEmoji();
        }else {
            return name;
        }
    }

    public static void main(String[] args) {
        for(int i = 0 ;i<100;i++){
            String name = ZHConverter.convert( getFirstName(),ZHConverter.TRADITIONAL) ;
            String pingname = Pinyin4jHelper.converterToSpell(name).split(",")[0];
            pingname = pingname.substring(0,1).toUpperCase()+pingname.substring(1);

            System.out.println( EngNameGenUtils.genFirstName(new Random().nextInt(2))+  " " +pingname);


        }


    }
}
